import request from "@/utils/request.js";

//药品列表
export function drugList(id, data) {
    return request.get('wx/order/drug/list/' + id, data);
}
//药品详情
export function drugInfo(id) {
    return request.get('wx/order/get/drugDetailInfo/' + id);
}
//用药频次
export function frequency() {
    return request.get('wx/common/getDictListByDictType?dictType=xy_drug_default_frequency', );
}
//用药途径
export function defaultuse() {
    return request.get('wx/common/getDictListByDictType?dictType=xy_drug_default_usage', );
}
//用药说明
export function instructions() {
    return request.get('wx/common/getDictListByDictType?dictType=xy_drug_instructions', );
}
//就诊人列表
export function patientList(data) {
    return request.get('wx/patient/list', data);
}
//获得专职医生
export function doctorList(data) {
    return request.get('wx/doctor/list', data);
}

//药房地址 医生id
export function pharmacy(id) {
    return request.get('wx/doctor/pharmacy/' + id);
}
//去预约
export function prescription(data) {
    return request.post('wx/order/reservation/prescription', data);
}
//用药咨询订单详情
export function orderdetail(id) {
    return request.get('wx/order/reserve/detail/' + id);
}
// export function orderdetail(){
//   return request.get('wx/order/reserve/detail/161');
// }
//获得患者处方列表
export function prescriptionList(data) {
    return request.get('wx/order/prescription/list', data);
}

//地址列表
export function addressList() {
    return request.get('wx/patient/address/list', );
}
//地址详情
export function addressDetails(id) {
    return request.get('wx/patient/address/detail/' + id);
}
//删除收货地址
export function deleteAddress(id) {
    return request.post('wx/patient/delete/address/' + id);
}
//获取帮助中心
export function faqList() {
    return request.get('wx/common/getAgreement/4');
}
//我的药品列表
export function drugOrder(status, data) {
    return request.get('wx/order/drug/order/list/' + status, data);
}
//我的问诊列表
export function inquiryList(status, data) {
    return request.get('wx/order/inquiry/list/' + status, data);
}
//退诊
export function refusal(id) {
    return request.post('foregin/order/withdrawal', id);
}
//地址修改
export function updateAddress(data) {
    return request.post('wx/patient/update/address', data);
}
//地址修改
export function orderDetails(data) {
    return request.post('wx/order/update/receipt/address', data);
}
// 6.查询所有省(token)
export function getHospitalProvince() {
    return request.get('wx/common/getListProvince')
}
// 7.查询省下面市(token)
export function getCity(cityId) {
    return request.get('wx/common/getListCity/' + cityId)
}
//8.查询市下面县（区）(token)
export function getCountyCity(cityId) {
    return request.get('wx/common/getListCity/' + cityId)
}
//地址新增
export function addAddress(data) {
    return request.post('wx/patient/add/address', data);
}
//查询最大可添加就诊人数
export function getMaxpeople() {
    return request.get('wx/common/getMaxPatientCount')
}
//订单里修改发票信息
export function updatebill(data) {
    return request.post('wx/order/update/bill', data);
}
//查询配送费
export function distributionFee() {
    return request.get('app/config/configKey/express_money');
}
//删除发票信息
export function deletebill(id) {
    return request.post('wx/order/del/bill/' + id);
}
//点击选择历史处方
export function handleSitePrescription(data) {
    return request.post('wx/order/handleSitePrescription', data);
}
//点击选择药品
export function handleHistoryDrug(data) {
    return request.post('wx/order/handleHistoryDrug', data);
}
// 取消订单
export function cancelOrder(id) {
    return request.post('foregin/order/product/refund', id);
}

//删除就诊人
export function deletePatient(id) {
    return request.get(`wx/patient/delete/patient/${id}`);
}
//判断药房库存情况
export function getStoreStartOpen(id) {
    return request.get(`wx/small/getStoreStartOpen?storeId=${id}`);
}